package com.createdevelopment.gaoyou;

import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

import com.createdevelopment.gaoyou.adapter.ImageAdapter;

@SuppressLint("NewApi")
public class InvestmentActivity extends Activity {
    private  Integer []mThumbIds = {
    	     R.drawable.investment_menu_policy,
    	     R.drawable.investment_menu_approvement,
    	     R.drawable.investment_menu_cost,
    	     R.drawable.investment_menu_area    
    	    };
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_investment);
		ActionBar bar = this.getActionBar();
		bar.setTitle("");
		bar.setBackgroundDrawable(getResources().getDrawable(R.drawable.investment_header_bg));
		bar.setDisplayUseLogoEnabled(false);
		bar.setDisplayShowHomeEnabled(false);
		
	    GridView gridview = (GridView) findViewById(R.id.investment_view);
	    ImageAdapter imageAdapter=new ImageAdapter(this);
	    imageAdapter.setmThumbIds(mThumbIds);
	    gridview.setAdapter(imageAdapter);

	    gridview.setOnItemClickListener(new OnItemClickListener() {
	        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
	            Intent intent=new Intent(InvestmentActivity.this,InvestmentAreaActivity.class);
	            startActivity(intent);
	        }
	    });
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.investment, menu);
		return true;
	}

}
